﻿<?php
// 检查是否登录
function check_login()
{
	$CI = & get_instance();
	$user_id = $CI->session->userdata('system_user_id');
	if(empty($user_id))
    {
        header('location:'.base_url().'manage/login');
    }
}

//权限检查
function pop_check($pop_content)
{ 
	$CI = & get_instance();
	$pop = $CI->session->userdata('system_user_popedom');
	if(is_bool(strpos($pop,$pop_content))){	
		$CI->sys_message->show_error('您无权操作该页面');
	}else
	{
		return 1;
	}
}

// 检查前台会员是否登录
function member_check_login(){
	$CI = & get_instance();
	$member_id = $CI->session->userdata('id');
	if(empty($member_id)){
            header('location:'.site_url().'member/reg');
            exit;
        }
        return $member_id;
}


// 公共上传方法 
function do_update(){
	echo 'xxx';
}


//隐私数据处理
function privacy($str, $num=2){
    
    $rp_length = strlen($str)-$num*2;
    return str_replace(substr($str,$num,$rp_length),'****',$str);
    
}

?>